#pragma once

class QueryBuffer
{
public:
	void push(char*query)
	{
		CAutoLock lock(&_lock);

		_buffer.push_back(query);
	}

	char * get()
	{
		CAutoLock lock(&_lock);

		char * tmp = _buffer.front();

		_buffer.pop_front();

		return tmp;
	}

protected:
private:
	list<char*> _buffer;
	CLock _lock;
};

class CYYMySqlCon//:public CLock,public QueryBuffer
{
public:
	MYSQL* _sql;
};

class CYYJob:public IJobDesc//,public CLock
{
public:
	CYYMySqlCon * _con;
	char _query[256];
protected:
private:
};

class CYYMysql;

class _DLL CYYWorker:public IWorker
{
public:
	CYYWorker(CYYMysql*sql)
	{
		_mysql = sql;
	}
	void ProcessJob(IJobDesc* pJob);
private:
	CYYMysql * _mysql;
};

typedef list<CYYMySqlCon*>YYMySqlConList;
typedef YYMySqlConList::iterator YYMySqlConListIt;

typedef list<CYYJob*>YYJobList;
typedef YYJobList::iterator YYJobListIt;